<template>
  <div>
    <h1>分页组件</h1>
    <el-pagination
    layout="prev, pager, next"
    :total="50">
  </el-pagination>
  <hr>
  <h2>完整的例子</h2>
  当前页：{{ currentPage1 }}
  <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage1"
      :page-size="100"
      layout="total,sizes, prev, pager, next"
      :total="1000">
    </el-pagination>
    <hr>
    <button @click="loading=!loading">加载/不加载-局部</button>
    <button @click="loading=!loading">加载/不加载-全屏</button>
    <div 
      v-loading.fullscreen="loading"
      element-loading-background="rgba(0, 0, 0, 0.4)"
       class="datas">
      异步数据
    </div>
    <h1>消息提示</h1>
    <button @click="showMsg1">点击显示提醒</button>
  </div>
</template>

<script>
  export default {
    methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
      showMsg1(){
        // this.$message("登录成功！");
        this.$message({
          message: '恭喜你，这是一条成功消息',
          type: 'success'
        });
      }
    },
    data() {
      return {
        loading:false,
        currentPage1: 5,
        currentPage2: 5,
        currentPage3: 5,
        currentPage4: 4
      };
    }
  }
</script>

<style scoped>
.datas{
  height: 200px;
  width: 200px;
  background-color: pink;
  justify-content: center;
  align-items: center;
  display: flex;
}
</style>